export default {
    UpdateIframeHeight(){
        //获取窗口当前滚动位置
        let scrollTop=document.documentElement.scrollTop;

        let iframeWin=document.getElementById("Layout_MainContainer");
        iframeWin.height=0;

        let height=iframeWin.contentDocument.body.clientHeight;
        let scrollHeight=iframeWin.contentDocument.documentElement.scrollHeight;
        // console.log(height)
        // console.log(scrollHeight)
        let margin=90;
        iframeWin.height=((height>scrollHeight?height:scrollHeight)+margin);

        //重置窗口滚动位置
        document.documentElement.scrollTop=scrollTop;
    },

    GetIFrame(){
        return document.getElementById("Layout_MainContainer");
    },

    SetURL(url){
        this.GetIFrame().src=url;
    },

    Reload(){
        this.GetIFrame().contentWindow.location.reload();
    },

    GetIFrameDocument(){
        return this.GetIFrame().contentDocument;
    }
}